package com.example.demo.service.admin.impl;

import com.example.demo.R.BanResult;
import com.example.demo.domin.dto.UserDTO;
import com.example.demo.mapper.UserMapper;
import com.example.demo.service.admin.IAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl  implements IAdminService {
    @Autowired
    private UserMapper userMapper;


    @Override
    public BanResult ban(String id, UserDTO userDto) {
        userMapper.ban(id);
        return BanResult.builder().ban_reason(userDto.getReason())
                .message("用户封禁成功")
                .user_id(Integer.getInteger(id))
                .build();
    }
}
